package com.jusha.formulacalculation.exception;

public class EvalException extends Exception {
    public int getColumn() {
        return column;
    }

    public void setColumn(int column) {
        this.column = column;
    }

    /**
     * 表达式中发生异常的位置
     */
    private int column;

    public EvalException(String message, int position) {
        super(message);
        column = position;
    }

    @Override
    public String getMessage() {
        return String.format("%s (column %d)", super.getMessage(), column + 1);
    }
}
